/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseContactEntity.cs
*        创建系统时间:       2012/11/2 19:07:02
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;
    using ECP.Utilities;

    [Serializable]
    public class BaseContactEntity
    {
        private string commentDate;
        private string commentUserID;
        private string commentUserRealName;
        private string content;
        private string createDate;
        private string createUserID;
        private string createUserRealName;
        private bool deleteMark;
        private string description;
        private bool enabled;
        private string id;
        private bool isPublic;
        private string modifyDate;
        private string modifyUserID;
        private string priority;
        private int readCount;
        private string receiverRealName;
        private int replyCount;
        private int sendCount;
        private string sortCode;
        private string title;

        public BaseContactEntity()
        {
        }

        public BaseContactEntity(DataRow dataRow)
        {
            this.GetFrom(dataRow);
        }

        public BaseContactEntity(DataTable dataTable)
        {
            this.GetFrom(dataTable);
        }

        public BaseContactEntity GetFrom(DataRow dataRow)
        {
            this.ID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldID]);
            this.ReceiverRealName = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldReceiverRealName]);
            this.Title = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldTitle]);
            this.Content = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldContent]);
            this.Priority = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldPriority]);
            this.SendCount = BaseBusinessLogic.ConvertToInt(dataRow[BaseContactTable.FieldSendCount]);
            this.ReadCount = BaseBusinessLogic.ConvertToInt(dataRow[BaseContactTable.FieldReadCount]);
            this.ReplyCount = BaseBusinessLogic.ConvertToInt(dataRow[BaseContactTable.FieldReplyCount]);
            this.IsPublic = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseContactTable.FieldIsPublic]);
            this.CommentUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldCommentUserID]);
            this.CommentUserRealName = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldCommentUserRealName]);
            this.CommentDate = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldCommentDate]);
            this.DeleteMark = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseContactTable.FieldDeleteMark]);
            this.Enabled = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseContactTable.FieldEnabled]);
            this.Description = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldDescription]);
            this.SortCode = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldSortCode]);
            this.CreateDate = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldCreateDate]);
            this.CreateUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldCreateUserID]);
            this.CreateUserRealName = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldCreateUserRealName]);
            this.ModifyDate = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldModifyDate]);
            this.ModifyUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactTable.FieldModifyUserID]);
            return this;
        }

        public BaseContactEntity GetFrom(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }

        public string CommentDate
        {
            get
            {
                return this.commentDate;
            }
            set
            {
                this.commentDate = value;
            }
        }

        public string CommentUserID
        {
            get
            {
                return this.commentUserID;
            }
            set
            {
                this.commentUserID = value;
            }
        }

        public string CommentUserRealName
        {
            get
            {
                return this.commentUserRealName;
            }
            set
            {
                this.commentUserRealName = value;
            }
        }

        public string Content
        {
            get
            {
                return this.content;
            }
            set
            {
                this.content = value;
            }
        }

        public string CreateDate
        {
            get
            {
                return this.createDate;
            }
            set
            {
                this.createDate = value;
            }
        }

        public string CreateUserID
        {
            get
            {
                return this.createUserID;
            }
            set
            {
                this.createUserID = value;
            }
        }

        public string CreateUserRealName
        {
            get
            {
                return this.createUserRealName;
            }
            set
            {
                this.createUserRealName = value;
            }
        }

        public bool DeleteMark
        {
            get
            {
                return this.deleteMark;
            }
            set
            {
                this.deleteMark = value;
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        public bool IsPublic
        {
            get
            {
                return this.isPublic;
            }
            set
            {
                this.isPublic = value;
            }
        }

        public string ModifyDate
        {
            get
            {
                return this.modifyDate;
            }
            set
            {
                this.modifyDate = value;
            }
        }

        public string ModifyUserID
        {
            get
            {
                return this.modifyUserID;
            }
            set
            {
                this.modifyUserID = value;
            }
        }

        public string Priority
        {
            get
            {
                return this.priority;
            }
            set
            {
                this.priority = value;
            }
        }

        public int ReadCount
        {
            get
            {
                return this.readCount;
            }
            set
            {
                this.readCount = value;
            }
        }

        public string ReceiverRealName
        {
            get
            {
                return this.receiverRealName;
            }
            set
            {
                this.receiverRealName = value;
            }
        }

        public int ReplyCount
        {
            get
            {
                return this.replyCount;
            }
            set
            {
                this.replyCount = value;
            }
        }

        public int SendCount
        {
            get
            {
                return this.sendCount;
            }
            set
            {
                this.sendCount = value;
            }
        }

        public string SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        public string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                this.title = value;
            }
        }
    }
}